package com.fishingwithme.infrastructure.mapper;


import com.fishingwithme.domain.credit.CreditLevelRule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 信用等级规则Mapper接口
 */
@Mapper
public interface CreditLevelRulesMapper extends BaseMapper<CreditLevelRule> {

    /**
     * 根据积分查询对应的等级规则
     *
     * @param points 积分值
     * @return 等级规则
     */
    CreditLevelRule selectByPoints(@Param("points") Integer points);

    /**
     * 分页查询等级规则
     *
     * @param page 分页参数
     * @return 分页结果
     */
    IPage<CreditLevelRule> selectPage(Page<CreditLevelRule> page);

    List<CreditLevelRule> selectAll();
}
